﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	BusMaterialAccountSearchEvent event = (BusMaterialAccountSearchEvent)context.getSessionValue("BusMaterialAccountSearchEvent");
	ObjectList list = BusMaterialAccount.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<%@page import="system.base.BusMaterialAccountBusiness"%>
<%@page import="system.base.BusMaterialAccount"%>
<%@page import="system.base.Warehouse"%>
<%@page import="java.util.Vector"%>
<%@page import="java.util.Map"%>
<script language=javascript>

var list_code = "listBusMaterialAccount";

function doSearch()
{
	//SetValue("s_Id",GetValue("i_Id")); //序号
	//SetValue("s_BusTypeCode",GetValue("i_BusTypeCode")); //车型编码
	//SetValue("s_BusCategoryCode",GetValue("i_BusCategoryCode")); //车类编码
	//SetValue("s_BusTag",GetValue("i_BusTag")); //车牌号
    //SetValue("s_RepairedMoney",GetValue("i_RepairedMoney")); //维修费用
    //SetValue("s_OrderField",GetValue("i_OrderField")); //排序
    //SetValue("s_OrderDesc",getCheckBoxValues("i_OrderDesc")); //升降序
    var time = GetValue("i_Year")+GetValue("i_Month");
    //alert(time);
	//SetValue("s_RepairenTime",GetValue("i_RepairenTime")); //维修时间
    //SetValue("s_WarehouseCode",GetValue("i_WarehouseCode")); //仓库编码
    SetValue("s_RepairenTime",time); //结算时间
	doCommonSearch();
}

function bizViewBusMaterialAccount(id)
{
	viewWin("<%=Config.getSrv()%>?action_code=viewBusMaterialAccount&Id="+id);
}

function doDelete()
{
	if(!hasChooseRadio("ids"))
	{
		bizMessage("删除","车辆维修材料费用");
		return false;
	}
	if(!bizConfirm("删除","车辆维修材料费用")) return false;
	SetAction("deleteBusMaterialAccount");
	frm.submit();
}

function doToAdd()
{
	SetAction("toAddBusMaterialAccount");
	frm.submit();
}

function doToUpdate()
{
	if(!checkOne("ids")) 
	{
		bizMessage("修改","车辆维修材料费用");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toUpdateBusMaterialAccount");
	frm.submit();
}
function doToCopy()
{
	if(!checkOne("ids")) 
	{
		bizMessage("复制","车辆维修材料费用");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toCopyBusMaterialAccount");
	frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>


<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域-->

<input type=hidden name="s_WarehouseCode" value="<%=event.getWarehouseCode()%>"> <!--仓库编码-->
<input type=hidden name="s_RepairenTime" value="<%=event.getRepairenTime()%>"> <!--维修时间-->

<%
String time = event.getRepairenTime();
String year = time.substring(0,4);
String month = time.substring(4,6);
%>
<%@ include file="/framework/list_head.jsp"%>

<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
	int key_tab = 1 ;
%>

    <%=uiSearchInputTR%>>
        <%=uiSearchInputTDHead%>>
            选择结算月份：
        </td>
        <%=uiSearchInputTDHead%>>
            <%=SelectManager.viewYearSelect(con,"i_Year",year,false,"","-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month",month,false,"","-请选择-","","")%>
            <input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;
        </td>       
    </tr>  

<%=uiSearchEnd%>

<!--列表标题--><%
    boolean isfirst = ((Boolean)(context.getSessionValue("isfirst"))).booleanValue();
    String menu = (String)context.getSessionValue("choice");
    Vector vec = (Vector)context.getValue(menu);
    //String[] warehouseCodes = null;
    //if(!isfirst && vec != null && vec.size() > 0){
        //warehouseCodes = BusMaterialAccountBusiness.getStr(vec,1);//得到所有的仓库编码
        //warehouseCodes = BusMaterialAccountBusiness.setStrArray(warehouseCodes);//去除重复的仓库编码
    //}
%>
<%String repairTime = event.getRepairenTime(); %>
<% 
if(isfirst || repairTime == null || repairTime.equals("000000") || repairTime.equals("")){%>
    <%=UIManager.addListHeadTitle("集团各公司费用比较")%>    
<%}else{%>
    <%=UIManager.addListHeadTitle("集团公司"+year+"年各公司费用比较")%>
<%}%>


<!--********************* Part6:List Area ***************-->

<%=uiListStart%>>
<%int index = 1 ;%>  
    <%=uiListHeadTR%>>
        <%=UIManager.addListHead("公司",index++)%>
        <%=UIManager.addListHead("最高费用金额",index++,"num")%>
        <%=UIManager.addListHead("最低费用金额",index++,"num")%>
        <%=UIManager.addListHead("月平均费用",index++,"num")%>
    <%=uiListHeadTREnd%>>
    <%if(!isfirst ){ %>
    <% if(vec != null && vec.size() > 0) {%>
        <%for(int i = 0;i < vec.size();i++){ %>
            <%String[] values = (String[])vec.get(i); %>
            <%=uiListDataTR[i%2]%> align=center>  
                <%=uiListDataTD%>><%=Warehouse.getNameByCode(con,values[0]) %></td>
                <%=uiListDataTD%>><%=StringUtil.showPrice(Double.parseDouble(values[1]),2) %></td>    
                <%=uiListDataTD%>><%=StringUtil.showPrice(Double.parseDouble(values[2]),2) %></td>   
                <%=uiListDataTD%>><%=StringUtil.showPrice(Double.parseDouble(values[3]),2) %></td>         
            </tr>
        <%} %>
        <%}else{  %>
          <%=uiListDataTR[0]%> align=center>  
            <%=uiListDataTD%> colspan = "9">查无记录</td>    
               
            </tr> 
        <%} %>
    <%} %>
    
    

<%=uiListEnd%>


<!--********************* Part7:Action Area ***************-->
</form>


<%@ include file="/framework/foot.jsp"%>

<!--
	Author    :Benny
	FileName  :/system/base/BusMaterialAccountList.jsp
-->

